Page({
  data: {
    sId: null,
    Cookie: null,
  },
  onLoad: function (options) {
  },
  onShow: function () {
  },
  formSubmit(e) {
    var that = this;
    console.log(e)
    var _sId = e.detail.value.sId;
    var _password = e.detail.value.password;
    console.log(_sId + _password)
    wx.request({
      url: 'https://geek-team.xin/grade/getLogin?username=' +
        _sId + '&password=' + _password,
      success(e) {
        console.log(e)
        that.setData({
          Cookie: e.data.Cookie
        })
        if (e.data.result == true) {
          wx.showLoading({
            title: '登录成功请稍后',
          })
          setTimeout(function () {
            wx.hideLoading()
            wx.navigateTo({
              url: encodeURI("../query/query?xm=" + e.data.xm + '&sId=' + _sId),
            })
          }, 2000)
        }
        else {
          wx.showToast({
            title: '密码错误',
            image: '../../../images/error.png',
            duration: 2000
          })
        }
      }
    });
  }
})